package structs

type ExchangeBase struct {
	Mid 				int 		`json:"mid" redis:"mid"`
	NameEn 				string 		`json:"name_en" redis:"name_en"`
	NameCn 				string 		`json:"name_cn" redis:"name_cn"`
	Slug 				string 		`json:"slug" redis:"slug"`
	Logo 				string 		`json:"logo" redis:"logo"`
	Description 		string 		`json:"description" redis:"description"`
	Country 			string 		`json:"country" redis:"country"`
	Mode 				string 		`json:"mode" redis:"mode"`
	Website 			string 		`json:"website" redis:"website"`
	Twitter 			string 		`json:"twitter" redis:"twitter"`
	Blog 				string 		`json:"blog" redis:"blog"`
	Chat 				string 		`json:"chat" redis:"chat"`
	Fee 				string 		`json:"fee" redis:"fee"`
	Enable 				int 		`json:"enable" redis:"enable"`
	Sort 				int 		`json:"sort" redis:"sort"`
	Recommend 			int 		`json:"recommend" redis:"recommend"`
	RecommendSort 		int 		`json:"recommend_sort" redis:"recommend_sort"`
}

type ExchangeTicker struct {
	Exchange 			string 		`json:"exchange" redis:"exchange"`
	AmountUsd 			string 		`json:"amount_usd" redis:"amount_usd"`
	CountPairs 			int 		`json:"count_pairs" redis:"count_pairs"`
	CountCoins 			int 		`json:"count_coins" redis:"count_coins"`
	CountMarkets 		int 		`json:"count_markets" redis:"count_markets"`
}

// 币种的概览信息，元信息，
type CoinBase struct {
	Id 					int 		`json:"id" redis:"id"`
	Mid 				int 		`json:"mid" redis:"mid"`
	NameEn 				string		`json:"name_en" redis:"name_en"`
	NameCn 				string 		`json:"name_cn" redis:"name_cn"`
	Symbol 				string 		`json:"symbol" redis:"symbol"`
	Slug 				string		`json:"slug" redis:"slug"`
	Logo 				string 		`json:"icon" redis:"icon"`
	Category 			string 		`json:"category" redis:"category"`
	Tags 				string 		`json:"tags" redis:"tags"`
	Description 		string		`json:"description" redis:"description"`
	Country 			string 		`json:"country" redis:"country"`
	Website 			string 		`json:"website" redis:"website"`
	Explorer			string 		`json:"explorer" redis:"explorer"`
	WhitePaper 			string 		`json:"white_paper" redis:"white_paper"`
	SourceCode 			string 		`json:"source_code" redis:"source_code"`
	MessageBoard 		string 		`json:"message_board" redis:"message_board"`
	Chat 				string 		`json:"chat" redis:"chat"`
	Announcement 		string 		`json:"announcement" redis:"announcement"`
	Reddit 				string 		`json:"reddit" redis:"reddit"`
	Twitter 			string 		`json:"twitter" redis:"twitter"`
	MaxSupply 			string 		`json:"max_supply" redis:"max_supply"`
	DateAdded 			string 		`json:"date_added" redis:"date_added"`
}

// 单币种行情数据
type CoinTicker struct {
	Symbol 				string			`json:"symbol" redis:"symbol"`
	Volume 				string			`json:"volume" redis:"volume"`
	Amount 				string			`json:"amount" redis:"amount"`
	Open 				string			`json:"open" redis:"open"`
	High 				string			`json:"high" redis:"high"`
	Low 				string			`json:"low" redis:"low"`
	Close 				string			`json:"close" redis:"close"`
	Percent				string 			`json:"percent" redis:"percent"`

	TotalSupply 		string			`json:"total_supply" redis:"total_supply"`
	CirculatingSupply 	string 			`json:"circulating_supply" redis:"circulating_supply"`

	// 市值=价格*流通量，流通量用coinmarket的可以
	MarketValue 		string 			`json:"market_value" redis:"market_value"`
	// 换手率=成交量/流通量，这个分子分母也可以从coinmarket上获取数据
	TurnoverRate 		string 			`json:"turnover_rate" redis:"turnover_rate"`
	NumMarketPairs 		int32			`json:"num_market_pairs" redis:"num_market_pairs"`
	NumExchange 		int32 			`json:"num_exchange" redis:"num_exchange"`
	USD 				string			`json:"usd" redis:"usd"`
	LastUpdated 		int64			`json:"last_updated" redis:"last_updated"`
}

type SaveKlineOption struct {
	IsNew 		bool
	Data 		[]string
}

type CoinKlineQueue struct {
	ExchangeName 		string 		`json:"n"`
	CoinName 			string 		`json:"c"`
	Timestamp 			int64 		`json:"t"`
	SymbolStr 			string 		`json:"s"`
}